package com.mask.common.swagger.handler;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class SwaggerSecurityHandler implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // swagger-ui
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        
        // webjars
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
                
        // doc.html
        registry.addResourceHandler("doc.html")
                .addResourceLocations("classpath:/META-INF/resources/");
    }
}

// mask:
//   swagger:
//     enabled: true
//     title: Mask API文档
//     description: Mask API文档
//     version: 1.0.0
//     author: mask
//     email: mask@example.com
//     base-package: com.mask
//     group-name: default


// @EnableCustomSwagger
// @SpringBootApplication
// public class Application {
//     public static void main(String[] args) {
//         SpringApplication.run(Application.class, args);
//     }
// }


// @Api(tags = "用户管理")
// @RestController
// @RequestMapping("/user")
// public class UserController {

//     @ApiOperation("获取用户列表")
//     @ApiImplicitParams({
//         @ApiImplicitParam(name = "pageNum", value = "页码", required = true, paramType = "query"),
//         @ApiImplicitParam(name = "pageSize", value = "每页数量", required = true, paramType = "query")
//     })
//     @GetMapping("/list")
//     public R<PageVO<UserVO>> list(@RequestParam Integer pageNum, @RequestParam Integer pageSize) {
//         return R.ok(userList);
//     }

//     @ApiOperation("创建用户")
//     @PostMapping
//     public R<Void> create(@RequestBody @Validated UserDTO userDTO) {
//         return R.ok();
//     }

//     @ApiOperation("更新用户")
//     @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path")
//     @PutMapping("/{id}")
//     public R<Void> update(@PathVariable Long id, @RequestBody @Validated UserDTO userDTO) {
//         return R.ok();
//     }

//     @ApiOperation("删除用户")
//     @ApiImplicitParam(name = "id", value = "用户ID", required = true, paramType = "path")
//     @DeleteMapping("/{id}")
//     public R<Void> delete(@PathVariable Long id) {
//         return R.ok();
//     }
// }



// @Data
// @ApiModel("用户信息")
// public class UserVO {
//     @ApiModelProperty("用户ID")
//     private Long id;

//     @ApiModelProperty("用户名")
//     private String username;

//     @ApiModelProperty("昵称")
//     private String nickname;

//     @ApiModelProperty("邮箱")
//     private String email;

//     @ApiModelProperty("手机号")
//     private String mobile;

//     @ApiModelProperty("状态（0正常 1停用）")
//     private String status;

//     @ApiModelProperty("创建时间")
//     private LocalDateTime createTime;
// }